define(function (require, exports, module) {


  require('andrew/card/index.js')

  var _ = require('third/lodash.js')

  var urlHelper = require("tools/urlHelper.js");

  var app = new Vue({
    data() {
      return {
        activeIndex: '2',
        menuTree: [{
          index: '2',
          name: '文章分类',
          url: './02_categoryList.html'
        }, {
          index: '1',
          name: '文章列表',
          url: './04_artList.html'
        },
        {
          index: '3',
          name: '前台配置类型',
          url: './configgroup/list.html'
        },
        // {
        //   index: '4',
        //   name: '前台配置',
        //   url: './pageconfig/list.html'
        // },
        {
          index: '5',
          name: '任务管理',
          url: './08_jobList.html'
        }],
        activeUrl: './02_categoryList.html'
      }
    },
    mounted: function () {

      if (gMain.debug) {
        var joinChar = this.activeUrl.indexOf("?") > -1 ? "&" : "?";
        this.activeUrl = this.activeUrl + joinChar + "debug=1";
      }


    },
    // mixins: [Element.mixin],
    methods: {
      handleSelect(key, keyPath) {
        console.log(keyPath)

        var pageVue = this
        var curMenuItem = _.find(pageVue.menuTree, { 'index': key })
        console.log(curMenuItem);

        if (gMain.debug) {
          var joinChar = curMenuItem.url.indexOf("?") > -1 ? "&" : "?";
          curMenuItem.url = curMenuItem.url + joinChar + "debug=1";
        }
        pageVue.activeUrl = curMenuItem.url
      }
    }
  }).$mount('#app')
})
